package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.IcUserMapper;
import com.ruoyi.system.domain.IcUser;
import com.ruoyi.system.service.IIcUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 微信用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-01
 */
@Service
public class IcUserServiceImpl implements IIcUserService 
{
    @Autowired
    private IcUserMapper icUserMapper;

    /**
     * 查询微信用户
     * 
     * @param iuId 微信用户主键
     * @return 微信用户
     */
    @Override
    public IcUser selectIcUserByIuId(Long iuId)
    {
        return icUserMapper.selectIcUserByIuId(iuId);
    }

    /**
     * 查询微信用户列表
     * 
     * @param icUser 微信用户
     * @return 微信用户
     */
    @Override
    public List<IcUser> selectIcUserList(IcUser icUser)
    {
        return icUserMapper.selectIcUserList(icUser);
    }

    /**
     * 新增微信用户
     * 
     * @param icUser 微信用户
     * @return 结果
     */
    @Override
    public int insertIcUser(IcUser icUser)
    {
        icUser.setCreateTime(DateUtils.getNowDate());
        return icUserMapper.insertIcUser(icUser);
    }

    /**
     * 修改微信用户
     * 
     * @param icUser 微信用户
     * @return 结果
     */
    @Override
    public int updateIcUser(IcUser icUser)
    {
        return icUserMapper.updateIcUser(icUser);
    }

    /**
     * 批量删除微信用户
     * 
     * @param iuIds 需要删除的微信用户主键
     * @return 结果
     */
    @Override
    public int deleteIcUserByIuIds(String iuIds)
    {
        return icUserMapper.deleteIcUserByIuIds(Convert.toStrArray(iuIds));
    }

    /**
     * 删除微信用户信息
     * 
     * @param iuId 微信用户主键
     * @return 结果
     */
    @Override
    public int deleteIcUserByIuId(Long iuId)
    {
        return icUserMapper.deleteIcUserByIuId(iuId);
    }

    @Override
    public IcUser selectIcUserByOpenId(String openid) {
        return icUserMapper.selectIcUserByOpenId(openid);
    }
}
